Typo in misc_sanity.sql?

  • Jump to comment-1
    japinli@hotmail.com2022-07-25T07:54:07+00:00
    Hi, hackers I found the misc_sanity has a SQL to check system catalogs that do not have primary keys, however, in current exceptions it says pg_depend, pg_shdepend don't have a unique key. Should we fix it? -- Regrads, Japin Li. ChengDu WenWu Information Technology Co.,Ltd.
    • Jump to comment-1
      tgl@sss.pgh.pa.us2022-07-25T11:39:00+00:00
      Japin Li <japinli@hotmail.com> writes: > I found the misc_sanity has a SQL to check system catalogs that > do not have primary keys, however, in current exceptions it says > pg_depend, pg_shdepend don't have a unique key. As indeed they do not: regression=# \d pg_depend Table "pg_catalog.pg_depend" Column | Type | Collation | Nullable | Default -------------+---------+-----------+----------+--------- classid | oid | | not null | objid | oid | | not null | objsubid | integer | | not null | refclassid | oid | | not null | refobjid | oid | | not null | refobjsubid | integer | | not null | deptype | "char" | | not null | Indexes: "pg_depend_depender_index" btree (classid, objid, objsubid) "pg_depend_reference_index" btree (refclassid, refobjid, refobjsubid) regression=# \d pg_shdepend Table "pg_catalog.pg_shdepend" Column | Type | Collation | Nullable | Default ------------+---------+-----------+----------+--------- dbid | oid | | not null | classid | oid | | not null | objid | oid | | not null | objsubid | integer | | not null | refclassid | oid | | not null | refobjid | oid | | not null | deptype | "char" | | not null | Indexes: "pg_shdepend_depender_index" btree (dbid, classid, objid, objsubid), tablespace "pg_global" "pg_shdepend_reference_index" btree (refclassid, refobjid), tablespace "pg_global" Tablespace: "pg_global" Your proposed wording seems to give strictly less information, so I do not see why it's an improvement. regards, tom lane
      • Jump to comment-1
        japinli@hotmail.com2022-07-25T12:04:30+00:00
        On Mon, 25 Jul 2022 at 19:39, Tom Lane <tgl@sss.pgh.pa.us> wrote: > Japin Li <japinli@hotmail.com> writes: >> I found the misc_sanity has a SQL to check system catalogs that >> do not have primary keys, however, in current exceptions it says >> pg_depend, pg_shdepend don't have a unique key. > > As indeed they do not: > > regression=# \d pg_depend > Table "pg_catalog.pg_depend" > Column | Type | Collation | Nullable | Default > -------------+---------+-----------+----------+--------- > classid | oid | | not null | > objid | oid | | not null | > objsubid | integer | | not null | > refclassid | oid | | not null | > refobjid | oid | | not null | > refobjsubid | integer | | not null | > deptype | "char" | | not null | > Indexes: > "pg_depend_depender_index" btree (classid, objid, objsubid) > "pg_depend_reference_index" btree (refclassid, refobjid, refobjsubid) > > regression=# \d pg_shdepend > Table "pg_catalog.pg_shdepend" > Column | Type | Collation | Nullable | Default > ------------+---------+-----------+----------+--------- > dbid | oid | | not null | > classid | oid | | not null | > objid | oid | | not null | > objsubid | integer | | not null | > refclassid | oid | | not null | > refobjid | oid | | not null | > deptype | "char" | | not null | > Indexes: > "pg_shdepend_depender_index" btree (dbid, classid, objid, objsubid), tablespace "pg_global" > "pg_shdepend_reference_index" btree (refclassid, refobjid), tablespace "pg_global" > Tablespace: "pg_global" > Yeah, they do not have unique keys, however, here we check primary keys. So, IMO, the description exceptions should say they do not have primary keys, rather than do not have unique keys. -- Regrads, Japin Li. ChengDu WenWu Information Technology Co.,Ltd.
    • Jump to comment-1
      bharath.rupireddyforpostgres@gmail.com2022-07-25T08:02:35+00:00
      On Mon, Jul 25, 2022 at 1:24 PM Japin Li <japinli@hotmail.com> wrote: > > > Hi, hackers > > I found the misc_sanity has a SQL to check system catalogs that > do not have primary keys, however, in current exceptions it says > pg_depend, pg_shdepend don't have a unique key. > > Should we fix it? Indeed. There's a clear difference between primary key and unique key. The patch LGTM. Regards, Bharath Rupireddy.